﻿using BaiduRules.CustomRule;
using BaiduRules;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NUnitTest.BaiduRule
{
    public class ValidatorBuilder
    { 
        public static ValidationResult Execute()
        {
            // 创建验证器并添加规则
            var validator = new Validator<int>();
            validator.AddRule(new GreaterThanZeroRule());
            validator.AddRule(new LessThan100Rule());
            // 验证数据
            var result = validator.Validate(-1);
            return result;
        }
    }
}
